@extends('content')

@section('content')
<div class="panel panel-success">
<div class="panel-heading">
	<h3 class="panel-title">添加模块</h3>
</div>
<div style="margin:0 auto;width:550px;">


	<div class="panel-body">
		<form class="form-horizontal" role="form" action="/module/store"  method="post">
				<input type="hidden" name="_token" value="{{ csrf_token() }}" />
			<div class="form-group">
				<label for="firstname" class="col-sm-2 control-label">模块名称</label>
				<div class="col-sm-10">
					<input type="text" class="form-control" id="firstname"
							 placeholder="请输入模块名称" name="name">
				</div>
			</div>
			<div class="form-group">
				<label for="lastname" class="col-sm-2 control-label">模块描述</label>
				<div class="col-sm-10">
					<input type="text" class="form-control" id="lastname"
							 placeholder="请输入模块描述" name="description">
				</div>
			</div>
			<div class="form-group">
				<label for="lastname" class="col-sm-2 control-label">上级级别</label>
				<div class="col-sm-10">
						<select class="form-control" name="parentId">
				      <option value="1">顶级模块</option>
							@foreach($modules as $key)
							<option value="{{ $key->id }}">{{ $key->name }}</option>
							@endforeach
	    			</select>
				</div>
			</div>
			<div class="form-group">
				<label for="lastname" class="col-sm-2 control-label">模块指向</label>
				<div class="col-sm-10">
					<input type="text" class="form-control" id="lastname"
							 placeholder="请输入模块指向地址" name="href">
				</div>
			</div>
			<div class="form-group">
				<label for="lastname" class="col-sm-2 control-label">排序位置</label>
				<div class="col-sm-10">
					<input type="text" class="form-control" id="lastname"
							 placeholder="请输入排序数字" name="orderId">
				</div>
			</div>
			<div class="form-group">
				<div class="col-sm-offset-2 col-sm-10">
					<button type="submit" class="btn btn-success">提交</button>
					<button type="button" class="btn btn-warning" onclick ="window.history.go(-1)">返回</button>
				</div>
			</div>
		</form>
	</div>
</div>

</div>
@stop
